home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
wb
/
remember.lha
/
Remember.p
< prev
next >
Wrap
Text File
|
1998-04-01
|
8KB
|
219 lines
; Remember 1.0
;
; (c) 1998 Cyborg
{* Include sys:coder/preass/Options.p *}
{* Include sys:coder/preass/Prozeduren.p *}
{* String: Version="$VER: Remember 1.0 30.3.98 (C) CYBORG 98"*}
{* IncBlock: Readynamen,1024*}
{* IncBlock: Backupnamen,1024*}
{* Include sources:Remember.fenster*}
{* IncVar: Name2,Name1,AppMessage*}
{* String: Portname="Remember"*}
PortUp[]:
movem.l a0-a3,-(sp)
cport=createmsgport()
addport(cport)
move.l cport,a0
lea 10(a0),a0
move.l #Portname,(a0)
movem.l (sp)+,a0-a3
RTS
PortDown[]:
movem.l a0-a3,-(sp)
RemPort(cPort)
deletemsgport(cport)
movem.l (sp)+,a0-a3
RTS
Printname[]:
Taskname=.l10(Task)
Bytes=Countstring(Taskname)
Write(OH,Taskname,Bytes)
Write(OH,"\n",1)
RTS
PrintTasks[Task]:
Task=.l0(Task)
If Task##0 {
Printname()
bra PrintTasks
}
RTS
PrintTasknames[]:
Waiting=406(Execbase)
Ready=420(Execbase)
Write(OH,"\nReady-Tasks\n-----------\n",?)
PrintTasks(Ready)
Write(OH,"\nWait-Tasks\n----------\n",?)
PrintTasks(Waiting)
RTS
GetTasknames[]:
Task=420(Execbase)
Lea Readynamen,a5
.GetTasknames1:
Task=.l0(Task)
Taskname=.l10(Task)
If Task##0 {
move.l Taskname,(a5)+
bra .GetTasknames1
}
Task=406(Execbase)
.GetTasknames2:
Task=.l0(Task)
Taskname=.l10(Task)
If Task##0 {
move.l Taskname,(a5)+
bra .GetTasknames2
}
move.l #0,(a5)+
RTS
VergleicheTaskzeiger[]:
Lea Readynamen,a0
Lea Backupnamen,a1
.l1:move.l (a0)+,d0
cmpi.l #0,d0
beq .OK
Lea Backupnamen,a1
.l2:cmpi.l #0,(a1)
beq .error
cmpi.l (a1)+,d0
bne .l2
bra .l1
.error:
moveq.l #0,d0
RTS
.ok:
moveq.l #-1,d0
RTS
WriteStrings[]:
lea Readynamen,a5
move.l #255,d6
.l1:move.l (a5)+,a4
cmpi.l #0,a4
beq .l2
bytes=Countstring(a4)
Write(FH,A4,Bytes)
Write(FH,"\n",1)
bra .l1
.l2:RTS
HideMode:
GetTasknames()
Copymem(#Readynamen,#Backupnamen,1024)
.Schleife:
Delay(50)
GetTasknames()
If VergleicheTaskzeiger()=#0 {
Result=DrawGuia(Gui,0)
Copymem(#Readynamen,#Backupnamen,1024)
If (FH=Open("Envarc:Remember.dump",#Mode_new))##0 {
WriteStrings()
Close(FH)
}
}
bra .Schleife
Start:
OH=Output()
GetFilename()
If Filename=#"HIDE" --> Hidemode
; PrintTasknames()
PortUp()
If (DiskObj=GetDiskObject("ProgDir:Remember"))=#0 --> PDown
If (AppIcon=AddAppIconA(0,0,"Remember",Cport,0,DiskObj,0))=#0 --> FDisk
GetTasknames()
Copymem(#Readynamen,#Backupnamen,1024)
OWin:
If Window##0 --> WaitMessage
If Open_window()=#0 --> RICON
If Create_Gadgets()##0 --> closewindow
WaitMessage:
For I=0 To 50
Delay(10)
GuiGadgetActionA(Gui,>GetTags:GEG_GetVar,GEG_Allgadgets|Tag_done,Null)
If (Msg=GetMsg(Cport))##0 {
move.l Msg,a0
Moveq.l #0,d0
lea 18(a0),a0
move.w (a0)+,d0
add.l d0,a0
move.l a0,AppMessage
AM_Type=.w0(AppMessage)
AM_NumArgs=.l10(AppMessage)
AM_ArgList=.l14(AppMessage)
If AM_Type##8 and AM_Type##7 --> WaitMessage
If AM_Numargs=#0 and AM_Arglist=#0 --> OWIN
Anzahl==AM_NumArgs
ArgList==AM_Arglist
ReplyMsg(Msg)
Bra OWin
}
If Window##0 and (Msg=GetGuiMsg(Gui))##0 {
MsgClass=.l36(Gui)
MsgGadNbr=.w52(Gui)
If MsgClass=#IDCMP_CloseWindow {
jsr Close_window
bra WaitMessage
}
GuiGadgetActionA(Gui,#GetTags)
If MsgGadNbr=#1 {
move.l name1,d0
swap d0
andi.l #$FFFF,d0
muls.l #4,d0
lea Readynamen,a0
add.l d0,a0
move.l (a0),Name2
Bytes=Countstring(Name2)
Result=Countstring(#befehlsstring)
If (FH=Open("envarc:Remember.tasks",#Mode_Old))##0 {
Seek(FH,0,#Offset_End)
Write(FH,Name2,Bytes)
Write(FH,"\n",1)
Write(FH,#Befehlsstring,Result)
Write(FH,"\n",1)
Close(FH)
}
}
If MsgGadNbr=#3 --> CloseWindow
}
Next I
Remember:
GetTasknames()
If VergleicheTaskzeiger()=#0 {
If Window##0 {
Result=DrawGuia(Gui,0)
}
Copymem(#Readynamen,#Backupnamen,1024)
If (FH=Open("Envarc:Remember.dump",#Mode_new))##0 {
WriteStrings()
Close(FH)
}
}
bra WaitMessage
Closewindow:
Close_window()
RIcon:
If AppIcon##0 {
RemoveAppIcon(AppIcon)
}
FDisk:
FreeDiskObject(DiskObj)
Pdown:
If (OK=GetMsg(Cport))##0 {
ReplyMsg(OK)
Bra Pdown
}
PortDown()
ende:
RTS